package com.xinz.srmi.impl.serialization;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;

public class Test {
	int id;
	String name;
	float len;
	Test other = this;
	Object array[] = new Object[]{name,other};
	
	public static void main(String[] args) throws Exception {
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		BeanOutputStream bos = new BeanOutputStream(baos);
		Test t = new Test();
		t.name = "www";
		bos.writeObject(t);
		ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray());
		BeanInputStream in = new BeanInputStream(bis);
		Test test = (Test) in.readObject();
		System.out.println(test.other.name);
	}
}
